import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import {RouterModule} from "@angular/router";
import {ApiService} from "../shared/api.service";
import { HomeComponent } from './home.component';
import { PublicComponent } from './public.component';
import {Admin1Component} from "./admin1.component";
import {AuthGuard} from "../core/auth.guard";



@NgModule({
  declarations: [
    HomeComponent,
    PublicComponent,
    Admin1Component
  ],
  imports: [
    CommonModule,
    RouterModule.forChild(
      [
        { path: '', redirectTo: 'home', pathMatch: 'full' },
        { path: 'home', component: HomeComponent },
        { path: 'admin1', component: Admin1Component, canActivate: [AuthGuard] },
        { path: 'public', component: PublicComponent },
      ]
    )
  ],
  providers: [
    ApiService,
  ]
})
export class BasicsModule { }
